﻿namespace Digitalmes.Application.Sys;

[ApiExplorerSettings(GroupName = "sys")]
public sealed class SysSafetyService : IDynamicWebApiService
{
    /// <summary>
    /// 查询
    /// </summary>
    /// <returns></returns>
    public SafetySetting? Get()
    {
        var model = RedisService.Instance.Get<SafetySetting>(AppConsts.SYSTEMSAFETY) ?? new SafetySetting();
        return model;
    }

    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    public void Add(SafetySetting model)
    {
        RedisService.Instance.SetJson(AppConsts.SYSTEMSAFETY, model);
    }
}
